// 单个权限项 (如果用于菜单/路由)
export interface IAuth {
	id: number;
	name: string;
	code: string; // 例如 'user:add', 'user:delete'
	children?: IAuth[];
}

export interface IProject {
	userId: number;
	id: number;
	title: string;
	introduce: string;
}

// 唯一的角色接口 (合并了 IRole 和 IRoleWithAuth)
export interface IRole {
	roleId: number;
	roleName: string;
	authority?: number[]; // 权限ID列表，设为可选
}

// 有权限的角色接口
export interface IRoleWithAuth {
	roleId: number;
	roleName: string;
	authority: [];
}

// 用户接口
export interface IUser {
	id: number;
	userName: string;
	nickName: string;
	role: IRole[]; // 用户的角色是完整的对象数组
}

// 用户查询接口
export interface IQueryUser {
	nickName: string;
	roleId: number; // 明确这是 roleId
}

// 用户编辑接口 (核心修改)
export interface IUserEdit {
	id: number;
	userName: string;
	nickName: string;
	roleIds: number[]; 
}